package uTatrusTests;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * <p>Title: HighScore.class Unit Tests </p>
 * <p>Description: CSIS 343 Course Project</p>
 * 
 * @author Nick Brown
 * @email  nicholas.brown@my.uwrf.edu
 * @author John Wagner 
 * @email  john.wagner@my.uwrf.edu
 * 
 * @date December 1st 2013
 *
 */
public class HighScoreTests {
	//instances of high score class
	private tatrus.HighScore hs1;
	private tatrus.HighScore hs2;
	
	/**
	 * @throws java.lang.Exception
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	/**
	 * @throws java.lang.Exception
	 */
	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	/**
	 * Sets up different tests, one testing a parameterized
	 * constructor and default. 
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		hs1 = new tatrus.HighScore("anthony", 9001);
		hs2 = new tatrus.HighScore();
	}

	/**
	 * Tears down instances after each test
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
		hs1 = null;
		hs2 = null;
	}

	/**
	 * Test method for {@link tatrus.HighScore#getScore()}.
	 * Tests to make sure constructors correctly set up each
	 * high score instance.
	 */
	@Test
	public final void testGetScore() {
		assertEquals(9001, hs1.getScore());
		
		assertEquals(0, hs2.getScore());
	}

	/**
	 * Test method for {@link tatrus.HighScore#toString()}.
	 * Tests the to string method to check for accuracy.
	 */
	@Test
	public final void testToString() {		
		assertEquals("   anthony                             9001", hs1.toString());
		
		assertEquals("   "+null+"                                      0", hs2.toString());
	}

}
